package com.jinyuanchun.learnjava.service.impl;

import com.jinyuanchun.learnjava.service.ProduceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class ProduceServiceImpl implements ProduceService {
    @Autowired
    RedisTemplate<String,Object> redisTemplate;
    @Override
    public void addMessage(String topic, Object message) {
        redisTemplate.opsForList().rightPush(topic,message);
    }
}
